package com.tsingteng.cosfun.ui.found.adapter;

import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.PagerAdapter;
import android.util.Pair;

import java.util.List;

/**
 * 活动视频adapter
 * author :zht
 */
public class FoundVideoPlayAdapter extends FragmentStatePagerAdapter {
    private List<Pair<String, Fragment>> mListPair;

    public FoundVideoPlayAdapter(FragmentManager fm, List<Pair<String, Fragment>> list) {
        super(fm);
        this.mListPair = list;
    }

    @Override
    public Fragment getItem(int position) {
        return mListPair.get(position).second;
    }

    @Override
    public int getCount() {
        return mListPair.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return mListPair.get(position).first;
    }

    @Override
    public int getItemPosition(@NonNull Object object) {
        return PagerAdapter.POSITION_NONE;
    }

    @Override
    public void restoreState(Parcelable state, ClassLoader loader) {
    }
}
